package com.gvtv.main.job;

import java.util.ArrayList;
import java.util.List;

public class JobInfo {

	private String id;
	private String name;
	private String type;
	private String refJob;
	private List<ParamInfo> params;
	
	public JobInfo(){
		
	}
	public JobInfo(String id, String name, String type, String refJob, List<ParamInfo> params) {
		super();
		this.id = id;
		this.name = name;
		this.type = type;
		this.refJob = refJob;
		this.params = params;
	}
	
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getRefJob() {
		return refJob;
	}
	public void setRefJob(String refJob) {
		this.refJob = refJob;
	}
	public List<ParamInfo> getParams() {
		return params;
	}
	public void setParams(List<ParamInfo> params) {
		this.params = params;
	}
	public void addParam(ParamInfo paramInfo){
		if(this.params==null){
			this.params = new ArrayList<ParamInfo>();
		}
		params.add(paramInfo);
	}
	@Override
	public String toString() {
		return "JobInfo[id="+this.getId()+", name="+this.getName()+", type="+this.getType()+", refJob="+this.getRefJob()+"]";
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		JobInfo other = (JobInfo) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}
	
}
